//
//  XJGoodsDetailSpecificationsCollectionViewCell.m
//  XinJiangMall
//
//  Created by Tzyang on 2018/4/11.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJGoodsDetailSpecificationsCollectionViewCell.h"

@interface XJGoodsDetailSpecificationsCollectionViewCell ()

@property (nonatomic ,strong) UILabel * xjgdSpecLab;
@property (nonatomic ,strong) UIImageView * xjgdRImgV;

@end

@implementation XJGoodsDetailSpecificationsCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = WHITE_COLOR;
        [self setuoSubviews];
    }
    return self;
}

- (UILabel *)xjgdSpecLab{
    if (!_xjgdSpecLab) {
        UILabel * xjgdSpecLab = [UILabel new];
        self.xjgdSpecLab = xjgdSpecLab;
        [self addSubview:xjgdSpecLab];
    }
    return _xjgdSpecLab;
}

- (UIImageView *)xjgdRImgV{
    if (!_xjgdRImgV) {
        UIImageView * xjgdRImgV = [UIImageView new];
        self.xjgdRImgV = xjgdRImgV;
        [self addSubview:xjgdRImgV];
    }
    return _xjgdRImgV;
}

- (void)setuoSubviews{
    UIView * xjgdLine = [[UIView alloc]initWithFrame:CGRectMake(ADAPTWidth(10), self.frame.size.height-0.5, KWidth - 2*ADAPTWidth(10) , 0.5)];
    xjgdLine.backgroundColor = XJCOLOR_RGB(221, 221, 221);
    [self addSubview:xjgdLine];
    
    self.xjgdSpecLab.font = XJFONTSET_R(14);
    self.xjgdSpecLab.textColor = XJCOLOR_RGB(17, 17, 17);
    self.xjgdSpecLab.text = @"选择套餐、规格等";
    CGFloat xjgdSpecLabW = [UILabel labelWithLabel:self.xjgdSpecLab
                                 getWidthWithTitle:self.xjgdSpecLab.text
                                              font:self.xjgdSpecLab.font];
    CGFloat xjgdSpecLabH = [UILabel labelWithLabel:self.xjgdSpecLab
                                  getHeightByWidth:xjgdSpecLabW
                                             title:self.xjgdSpecLab.text
                                              font:self.xjgdSpecLab.font];
    self.xjgdSpecLab.sd_layout
    .leftSpaceToView(self, ADAPTWidth(12))
    .centerYEqualToView(self)
    .widthIs(xjgdSpecLabW)
    .heightIs(xjgdSpecLabH);
    
    [self.xjgdRImgV setImage:[UIImage imageNamed:@"direction_right_gray"]];
    self.xjgdRImgV.sd_layout
    .rightSpaceToView(self, ADAPTWidth(12))
    .centerYEqualToView(self)
    .widthIs(12)
    .heightIs(12);
    
    
}

@end
